package com.lp.utils;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

import java.io.IOException;

/**
 * @author 路平
 * @create 2021-04-14 22:37
 */
public class MDUtils {
    public static Object getMD5Password(String password,ByteSource credenttialSalt) throws IOException {
        String hashAlgorIthName="MD5";
        int hashIterations=1024;
        ByteSource salt=ByteSource.Util.bytes(credenttialSalt);
        Object MD5Password=new SimpleHash(hashAlgorIthName,password,salt,hashIterations);
        return MD5Password;
    }
}
